#include <iostream>
#include <vector>
#include <string>
#include <QApplication>
#include <WidgetsManager.h>
#include <BuildManager.h>
#include <math.h>
#include <DefineCommon.h>
#include <QFile>
#include <QTextStream>

// #include <DialogDataMonitor.h>

int main(int argc, char *argv[])//
{
    QFile file(":/resources/qss/Ubuntu.qss"); // 如果 QSS 文件是资源文件的一部分  
    QString styleSheet;
    if (file.open(QIODevice::ReadOnly | QIODevice::Text))  
    {
        QTextStream in(&file);  
        styleSheet = in.readAll();  
        file.close();  
    }


    QApplication app(argc, argv);

    if(styleSheet.isEmpty() == false)
    {
        app.setStyleSheet(styleSheet);
    }

	/*QPixmap pixmap("test/splash.png");
	QSplashScreen splash(pixmap);
	splash.show();

	QTime t;
	t.start();
	while (t.elapsed()<100)
		QCoreApplication::processEvents();*/


	BuildManager::instance()->buildUi();
	WidgetsManager::instance()->getWidgetFromMap("WidgetMainWindow")->showMaximized();

    // ELOG_DEBUG("ExeUiOsg: main");
    // DialogDataMonitor* dialog = new DialogDataMonitor;
    // dialog->show();

	//WidgetsManager::instance()->showMaximized();
	//splash.finish(WidgetsManager::instance());
	
	return app.exec();
    // testWrapCodeGenerator();
}
